public class Main {
    public static void main(String[] args) {

        Animal dog = new Dog();
        Animal cat = new Cat();

        Afraid afraidDog = new Dog();
        Afraid afraidCat = new Cat();

        Person person = new Person();


        person.feed(dog);
        person.feed(cat);


        person.catchAnimal(afraidDog);
        person.catchAnimal(afraidCat);


        System.out.println("\n直接调用动物的进食方法：");
        dog.eat();
        cat.eat();
    }
}